        <include file="Public:top_frame" />
        <!-- /section:basics/navbar.layout -->
        <div class="main-container" id="main-container">
            <script type="text/javascript">
                try{ace.settings.check('main-container' , 'fixed')}catch(e){}
            </script>
            <include file="Public:left_frame" />
            <!-- /section:basics/sidebar -->
            <div class="main-content">
                <div class="main-content-inner">
                    <!-- #section:basics/content.breadcrumbs -->
                    <div class="breadcrumbs" id="breadcrumbs">
                        <script type="text/javascript">
                            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
                        </script>

                        <ul class="breadcrumb">
                            <li>
                                <i class="ace-icon fa fa-home home-icon"></i>
                                <a href="{:U('/index/index')}">首页</a>
                            </li>

                            <li>
                                会员管理
                            </li>
                        </ul><!-- /.breadcrumb -->
                        <!-- /section:basics/content.searchbox -->
                    </div>

                    <!-- /section:basics/content.breadcrumbs -->
                    <div class="page-content">
                        <div class="page-header">
                            <h1>
                                会员一览
                            </h1>
                        </div><!-- /.page-header -->

                        <div class="row">
                            <div class="col-xs-12">
                                <!-- PAGE CONTENT BEGINS -->
                                <div class="row">
                                    <div class="col-xs-12">
                                        <!-- <div class="table-header">
                                            Results for "Latest Registered Domains"
                                        </div> -->
                                        <div class="space-4"></div>
                                        <div>
                                            <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                                <thead>
                                                    <tr>
                                                        <th class="center">序号
                                                        </th>
                                                        <th>昵称</th>
                                                        <th>
                                                            <i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>
                                                            注册时间
                                                        </th>
                                                        <th class="hidden-480">是否可以参赛</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>

                                                <tbody>
                                                    <volist name="member_info" id="ls" key="k">
                                                        <tr>
                                                            <td class="center">{$k}</td>
                                                            <td> <a href="__URL__/detail/id/{$ls.id}">{$ls.nickname}</a> </td>
                                                            <td>{$ls.regtime|timeToDate}</td>
                                                            <td class="hidden-480">{$ls.match_flg|showYesOrNo}</td>
                                                            <td>
                                                                <div class="hidden-sm hidden-xs action-buttons">
                                                                    <a class="blue" href="__URL__/detail/id/{$ls.id}">
                                                                        查看
                                                                    </a>
                                                                    <!--<a class="blue" href="javascript:void(0)" onclick="supplement('{$ls.id}')">-->
                                                                        <!--信息补充-->
                                                                    <!--</a>-->
                                                                    <if condition="$ls.match_flg eq 1 ">
                                                                        <a class="blue" href="javascript:void(0)" onclick="change_status('{$ls.id}', 0, '{$ls.nickname}')">
                                                                            停赛
                                                                        </a>
                                                                        <else />
                                                                        <a class="blue" href="javascript:void(0)" onclick="change_status('{$ls.id}', 1, '{$ls.nickname}')">
                                                                            恢复比赛
                                                                        </a>
                                                                    </if>
                                                                    <!--<a class="red" href="javascript:void(0)" onclick="del_member('{$ls.id}', '{$ls.nickname}')">-->
                                                                        <!--删除-->
                                                                    <!--</a>-->
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </volist>
                                                </tbody>
                                            </table>
                                        </div>
                                        <div class="space-4"></div>
                                        <!--<div>-->
                                        	<!--<button class="btn btn-white btn-info btn-bold" onclick="javascript:window.open('__URL__/downloadAsCsv')">-->
												<!--<i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>-->
												<!--Export CSV-->
											<!--</button>-->
										<!--</div>-->
                                    </div>
                                </div>
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content -->
                </div>
            </div><!-- /.main-content -->
            <include file="Public:footer" />
        </div><!-- /.main-container -->
        <!-- basic scripts -->
        <div id="dialog-confirm" class="hide">
            <div class="alert bigger-110 del_info">
                <!-- These items will be permanently deleted and cannot be recovered. -->
            </div>
        </div><!-- #dialog-confirm -->
		<div id="dialog-confirm-1" class="hide">
            <div class="alert bigger-110 operation">
                <!-- These items will be permanently deleted and cannot be recovered. -->
            </div>
        </div><!-- #dialog-confirm -->
        <!--[if !IE]> -->
        <script type="text/javascript">
            window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery.js'>"+"<"+"/script>");
        </script>
        <!-- <![endif]-->

        <!--[if IE]>
        <script type="text/javascript">
            window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery1x.js'>"+"<"+"/script>");
        </script>
        <![endif]-->
        <script type="text/javascript">
            if('ontouchstart' in document.documentElement) document.write("<script src='__PUBLIC__/admin/assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
        </script>
        <script src="__PUBLIC__/admin/assets/js/bootstrap.js"></script>

        <!-- page specific plugin scripts -->
        <script src="__PUBLIC__/admin/assets/js/jquery-ui.js"></script>
        <script src="__PUBLIC__/admin/assets/js/jquery.ui.touch-punch.js"></script>

        <!-- page specific plugin scripts -->
        <script src="__PUBLIC__/admin/assets/js/jquery.dataTables.js"></script>
        <script src="__PUBLIC__/admin/assets/js/jquery.dataTables.bootstrap.js"></script>

        <!-- ace scripts -->
        <script src="__PUBLIC__/admin/assets/js/ace/elements.scroller.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.colorpicker.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.fileinput.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.typeahead.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.wysiwyg.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.spinner.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.treeview.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.wizard.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/elements.aside.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.ajax-content.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.touch-drag.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.sidebar.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.sidebar-scroll-1.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.submenu-hover.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.widget-box.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.settings.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.settings-rtl.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.settings-skin.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.widget-on-reload.js"></script>
        <script src="__PUBLIC__/admin/assets/js/ace/ace.searchbox-autocomplete.js"></script>

        <!-- inline scripts related to this page -->
        <script type="text/javascript">
            jQuery(function($) {
                $('.nav-list li').removeClass('open').removeClass('active');
                $('#left_5').addClass('open').addClass('active');
                $('#left_5_1').addClass('active');
                var oTable1 =
                        $('#sample-table-2')
                            //.wrap("<div class='dataTables_borderWrap' />")   //if you are applying horizontal scrolling (sScrollX)
                                .dataTable({
                                    bAutoWidth: false,
                                    "aoColumns": [
                                        null,
                                        {"bSortable": false},
                                        {"bSortable": false},
                                        {"bSortable": false},
//                                        {"bSortable": false},
                                        {"bSortable": false}
                                    ],
                                    "aaSorting": [],
                                    "oLanguage": {
                                        "sLengthMenu": "每页 _MENU_ 条记录",
                                        "sZeroRecords": "对不起，查询不到相关数据！",
                                        "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",
                                        "sSearch": "搜索: ",
                                        "oPaginate": {
                                            "sFirst": "首页",
                                            "sPrevious": "上一页",
                                            "sNext": "下一页",
                                            "sLast": "尾页"
                                        }
                                    }


                                    //,
                                    //"sScrollY": "200px",
                                    //"bPaginate": false,

                                    //"sScrollX": "100%",
                                    //"sScrollXInner": "120%",
                                    //"bScrollCollapse": true,
                                    //Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered"
                                    //you may want to wrap the table inside a "div.dataTables_borderWrap" element

                                    //"iDisplayLength": 50
                                });
                /**
                var tableTools = new $.fn.dataTable.TableTools( oTable1, {
                    "sSwfPath": "__PUBLIC__/admin/__PUBLIC__/admin/copy_csv_xls_pdf.swf",
                    "buttons": [
                        "copy",
                        "csv",
                        "xls",
                        "pdf",
                        "print"
                    ]
                } );
                $( tableTools.fnContainer() ).insertBefore('#sample-table-2');
                */
                
                
                //oTable1.fnAdjustColumnSizing();
            
            
                $(document).on('click', 'th input:checkbox' , function(){
                    var that = this;
                    $(this).closest('table').find('tr > td:first-child input:checkbox')
                    .each(function(){
                        this.checked = that.checked;
                        $(this).closest('tr').toggleClass('selected');
                    });
                });
            
                $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});

                function tooltip_placement(context, source) {
                    var $source = $(source);
                    var $parent = $source.closest('table')
                    var off1 = $parent.offset();
                    var w1 = $parent.width();
            
                    var off2 = $source.offset();
                    //var w2 = $source.width();
            
                    if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
                    return 'left';
                }
            });

			//override dialog's title function to allow for HTML titles
			$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
				_title: function(title) {
					var $title = this.options.title || '&nbsp;'
					if( ("title_html" in this.options) && this.options.title_html == true )
						title.html($title);
					else title.text($title);
				}
			}));

            function change_status(id, match_flg, nickname) {
                var txt = "";
                if (match_flg == 0) {
                    txt = '停赛';
                    $(".operation").html('确定停止【' + nickname + '】的比赛?');
                } else {
                    txt = '恢复比赛';
                    $(".operation").html('确定恢复【' + nickname + '】的比赛?');
                }

                $("#dialog-confirm-1").removeClass('hide').dialog({
                    resizable: false,
                    modal: true,
                    title: "<div class='widget-header'><h4 class='smaller'> "+ txt +"会员</h4></div>",
                    title_html: true,
                    buttons: [
                        {
                            html: txt,
                            "class" : "btn btn-primary btn-xs",
                            click: function() {
                                //alert(match_flg);
                                $.ajax({
                                    type: "POST",
                                    dataType: "json",
                                    data: {
                                        id: id,
                                        status: match_flg
                                    },
                                    async: true,
                                    url: "__URL__/memberStatus",
                                    success : function(res) {
                                        if (res) {
                                            if (res.code==100) {
                                                alert(res.message);
                                                window.location.href = '__URL__/index';
                                            } else {
                                                alert(res.message);
                                                window.location.href = '__URL__/index';
                                            }
                                        } else {
                                            alert(txt + "失败");
                                        }
                                    },
                                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                                        alert("网络异常");
                                    }
                                });
                            }
                        },
                        {
                            html: "取消",
                            "class" : "btn btn-xs",
                            click: function() {
                                $(this).dialog("close");
                            }
                        }
                    ]
                });
            }

			function del_member(id, nickname) {
				$(".del_info").html('确定删除会员 < ' +  nickname  + ' > ?');
                $( "#dialog-confirm" ).removeClass('hide').dialog({
                    resizable: false,
                    modal: true,
                    title: "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-exclamation-triangle red'></i> 删除会员</h4></div>",
                    title_html: true,
                    buttons: [
                        {
                            html: "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; 删除",
                            "class" : "btn btn-danger btn-xs",
                            click: function() {
				                $.ajax({
				                    type: "POST",
				                    dataType: "json",
				                    data: {
				                        id: id,
                                        model: 'member'
				                    },
				                    async: true,
				                    url: "__URL__/delRole",
				                    success : function(data) {
				                        if (data) {
				                            if (data.status) {
				                                window.location.href = '__URL__/index';
				                            } else {
				                                alert(data.message);
				                                return;
				                            }
				                        } else {
				                            alert("删除失败");
				                        }
				                    },
				                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                                        alert("网络异常");
				                    }
				                });
                            }
                        },
                        {
                            html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; 取消",
                            "class" : "btn btn-xs",
                            click: function() {
                                $(this).dialog("close");
                            }
                        }
                    ]
                });
			}

            function account_detail(id) {
                window.location.href ="__URL__/account/id/" + id;
            }

            function supplement(id) {
                window.location.href ="__URL__/supplement/id/" + id;
            }

            function withdraw(id) {
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    data: {
                        memberid: id,
                    },
                    async: true,
                    url: "__URL__/doWithdraw",
                    success : function(ret) {
                        if (ret) {
                            if (ret.status) {
                                window.location.href = '__URL__/index';
                            } else {
                                alert(ret.message);
                                return;
                            }
                        } else {
                            alert("删除失败");
                        }
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                        alert("网络异常");
                    }
                });
            }
        </script>
    </body>
</html>
